<!-- http://www.imooc.com/wiki/uniapp/databinding.html -->
<template>
	<view>
		<view class="uni_root">
			<!-- <view @click="showName">啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊</view> -->
			<!-- <view @click='forceJump1'> 强制跳转1 </view>
			<intervalBar></intervalBar>
			<view @click='forceJump2'> 强制跳转2 </view>
			<view v-if="scrollIndex == 2"> =========== </view> -->
			<!-- <view v-if="verified"> ~~~~~~~~~~~~ </view> -->
			
		    <myTab 
				ref="myTab"
		        v-model="activeKey" 
				:scrollIndex="scrollIndex"
		        :navData="scrollData"
		        @change="tabChange"
		        @tabClick="tabClick"
				:tabFix="{position:'fixed'}"
				id="target"
		    >
		        <view :slot="item.slot" v-for="(item,key) in scrollData" :key="key">
					
		            <scroll-view scroll-y height="400rpx">
						
						<view class='forest' v-if="scrollIndex == 1">
							<!-- 标题 -->
							<!-- <view class="page-title" @click="showName">
								<view class="page-title__wrapper">
									<text class="page-title__text">{{title}}</text>
								</view>
							</view> -->
							<intervalBar></intervalBar>
							<intervalBar></intervalBar>
							<intervalBar></intervalBar>
							
							<bdphonecode :phone_number_dc='phone_number' 
							:verify_code_dc='verify_code_dc'
							@retMsg='getMsg'
							@clickedverifyCodeButton='clickedverifyCodeButton'
							>
							</bdphonecode>
							
							<intervalBar></intervalBar>
							<intervalBar></intervalBar>
							<intervalBar></intervalBar>
							
							<!-- 姓名 -->
							<bdinput :dc='name' @retMsg='getMsg' v-if="forceReset" v-model='user_info.name'></bdinput>
							
							<!-- 选择性别 -->
							<bdpicker :dc='sex' @retMsg='getPickerMsg' v-if="forceReset"></bdpicker>
							
							<!-- 选择工种 -->
							<bdpicker ref="child" v-if="hackReset" :dc='selected_major' @retMsg='getPickerMsg'></bdpicker>
							
							<!-- 培训类型 -->
							<bdpicker :dc='examination_type' @retMsg='getPickerMsg'></bdpicker>
							
							<!-- 身份证号码 -->
							<!-- <bdinput :dc='id_card_numbers' @retMsg='getMsg' v-if="forceReset"></bdinput> -->
							
							<intervalBar></intervalBar>
							<intervalBar></intervalBar>
							<intervalBar></intervalBar>
							
							<!-- 学校 -->
							<!-- <bdinput :dc='current_school' @retMsg='getMsg' v-if="forceReset"></bdinput> -->
							<!-- <bdinput :dc='current_class' @retMsg='getMsg' v-if="forceReset"></bdinput> -->
							
							<!-- 省市区选择器 -->
							<view class="picker_view">
								<!-- 文本 -->
								<view class='picker_text'>
									<text>{{"地址选择"}}</text>
								</view>
								<view class="picker"  @click="addressShow = true" >
									<view class="picker_input">
										<input maxlength="20"
										:placeholder="address?address:'点击选择地址'"
										 disabled="true"
										 />
									</view>
									<uni-icons class="icons" type="arrowright" size="20"/>
								</view>
							    <view class="picker_address">
							        <pickerAddress v-model="addressShow" @confirm="addresspick" />
							    </view>
							</view>
							<!-- 详细地址 -->
							<!-- <bdinput :dc='address_detail' @retMsg='getMsg' v-if="forceReset"></bdinput> -->
							
							<intervalBar></intervalBar>
							
							<!-- {height:`${swiperheight}px`} -->
							<view class='buttons fillBottom' :style="{height:`${swiperheight}px`}">
								<button class='submit_button' @click="showData">提交数据</button>
							</view>
							
							
						</view>
						
						<view class='formal' v-if="scrollIndex == 2">
							<intervalBar></intervalBar>
							
							<!-- 标题  && verified -->
							<!-- <view class="page-title" @click="showName">
								<view class="page-title__wrapper">
									<text class="page-title__text">{{title}}</text>
								</view>
							</view> -->
							
							<bdphonecode :phone_number_dc='phone_number' 
							:verify_code_dc='verify_code_dc'
							@retMsg='getMsg'
							@clickedverifyCodeButton='clickedverifyCodeButton'
							>
							</bdphonecode>
							
							<intervalBar></intervalBar>
							
							<view v-if="formal_register_state == 'has_verified'">
								
								<view v-if="user_info.is_active == false" class="fillBottom"  :style="{height:`${swiperheight_1}px`}">
									<view class="formal_text">
										检测到您的预报名申请还未审核通过! 请耐心等待审核员审核, 并注意短信通知...
									</view>
									
								</view>
								<view v-else>
									
									<!-- 姓名 -->
									<bdinput :dc='name' @retMsg='getMsg' v-if="forceReset" v-model='user_info.name'></bdinput>
									
									<!-- 选择性别 -->
									<bdpicker :dc='sex' @retMsg='getPickerMsg' v-if="forceReset"></bdpicker>
									
									<!-- 选择专业 -->
									<bdpicker ref="child" v-if="hackReset" :dc='selected_major' @retMsg='getPickerMsg'></bdpicker>
									
									<!-- 培训类型 -->
									<bdpicker :dc='examination_type' @retMsg='getPickerMsg'></bdpicker>
									
									<!-- 身份证号码 -->
									<bdinput :dc='id_card_numbers' @retMsg='getMsg' v-if="forceReset"></bdinput>
									
									<intervalBar></intervalBar>
									<!-- 省市区选择器 -->
									<view class="picker_view">
										<!-- 文本 -->
										<view class='picker_text'>
											<text>{{"地址选择"}}</text>
										</view>
										<view class="picker"  @click="addressShow = true" >
											<view class="picker_input">
												<input maxlength="20"
												:placeholder="address?address:'点击选择地址'"
												 disabled="true"
												 />
											</view>
											<uni-icons class="icons" type="arrowright" size="20"/>
										</view>
									    <view class="picker_address">
									        <pickerAddress v-model="addressShow" @confirm="addresspick" />
									    </view>
									</view>
									
									<!-- 详细地址 -->
									<bdinput :dc='address_detail' @retMsg='getMsg' v-if="forceReset"></bdinput>
									
									<intervalBar></intervalBar>
									
									<!-- 学历 -->
									<bdpicker :dc='education_degree' @retMsg='getPickerMsg' v-if="forceReset"></bdpicker>
									<!-- <bdpicker :dc='is_graduated' @retMsg='getPickerMsg' v-if="forceReset"></bdpicker> -->
									
									<bdinput :dc='graduated_school' @retMsg='getMsg' v-if="forceReset"></bdinput>
									<bdinput :dc='graduated_year' @retMsg='getMsg' v-if="forceReset"></bdinput>
									<bdinput :dc='graduated_month' @retMsg='getMsg' v-if="forceReset"></bdinput>
									<!-- <bdTimePicker :dc="graduated_date" @retMsg="getMsg"></bdTimePicker> -->
									
									<intervalBar></intervalBar>
									
									<!-- <bdinput :dc='obtained_certificate_name' @retMsg='getMsg' v-if="forceReset"></bdinput> -->
									
									<!-- 准操项目 -->
									<bdpicker :dc='access_project' @retMsg='getPickerMsg'></bdpicker>
									
									<!-- 已获证书 -->
									<bdpicker :dc='obtained_certificate_name' @retMsg='getPickerMsg'></bdpicker>
									
									<bdTimePicker v-if='obtained_certificate_name.value && obtained_certificate_name.value != "无"' :dc="obtained_certificate_time" @retMsg="getMsg"></bdTimePicker>
									
									<intervalBar></intervalBar>
									<!-- <bdinput :dc='work_category' @retMsg='getMsg' v-if="forceReset"></bdinput> -->
									<bdinput :dc='work_place' @retMsg='getMsg' v-if="forceReset"></bdinput>
									<bdinput :dc='work_port' @retMsg='getMsg' v-if="forceReset"></bdinput>
									<!-- <bdinput :dc='work_duration' @retMsg='getMsg' v-if="forceReset"></bdinput> -->
									
									<intervalBar></intervalBar>
									
									<!-- 图片选择 -->
									<view class='images_container'>
										<view style="position: relative;"  v-for="(item, index) in getImageList()" :key="index">
											<view v-if="item">
												<view class='show_img_container'>
													<!-- <image class="shancs" src="/static/images/c1.png"></image> -->
													
													<!-- <image class="shancs" src="/pages/submitInfo/shanchus2.png" mode="" @click="selec(index)"></image> -->
													<image class="shancs" src="/static/images/shanchus2.png" mode="" @click="selec(index)"></image>
													<!-- <image class="shancs" src="./shanchus2.png" mode="" @click="selec(index)"></image> -->
													<image class='show_img' 
														@click="preview(item)"
														:src="item">
													</image>
												</view>
											</view>
											<view v-else>
												<view class='dont_have_img_container' @click="chooseImage(index)">
													<text class='img_text'>{{getImageTextList(index)}}</text>
												</view>
											</view>
										</view>
									</view>
									
									<intervalBar></intervalBar>
									
									
									<view class='buttons'>
										<button class='submit_button' @click="formalRegister">正式报名</button>
									</view>
									
									<intervalBar></intervalBar>
								</view>
							</view>
							<view v-else class='fillBottom_1' :style="{height:`${swiperheight_1}px`}">
								<view class="formal_text">
									请先进行手机号验证~
								</view>
							</view>
							
						</view>
					</scroll-view>
					
				</view>
			</myTab>
		</view>
	
	</view>
</template>


<script>
	import myTab from '@/components/Mark-Tab/Tab.vue'
	import bdpicker from "components/bdpicker/bdpicker.vue"
	import bdinput from "components/bdpicker/bdinput.vue"
	import bdphonecode from "../../components/bdpicker/bdphonecode.vue"
	import intervalBar from "../../components/bdpicker/intervalBar.vue"
	import pickerAddress from '@/components/liudx-pickerAddress/bd_index.vue'
	import bdTimePicker from "../../components/bdpicker/bdTimePicker.vue"
	// import * as bdUtil from '../../util/bdUtil.js'
	import cache from '../../util/cache.js'

	export default {
		//注册组件
		components: {
			myTab,
			intervalBar,
			bdpicker,
			bdinput,
			pickerAddress,
			bdphonecode,
			bdTimePicker,
			// ttt,
			// myPicker
		},
		data () {
			return {
				// newsPanelHeight: 0;
				swiperheight: 200,
				swiperheight_1: 100,
				activeKey: 0,		// 标签栏初始位置
				scrollIndex: 1,		// 标签栏当前位置
				scrollData: [
					{
						label:'预报名',
						slot:'slot-1'
					},
					{
						label:'正式报名',
						slot:'slot-2'
					}
				],
				verified: false,
				v: 123,
				imageStyles:{
					width: 128,
					height: 128,
					// border:{
					// 	color:"#ff5a5f",
					// 	width:2,
					// 	style:'dashed',
					// 	radius:'2px'
					// },
					// margin-left: 20,
					// padding: 20,
				},
				title: '预报名申请表',
				imageValue:[],
				// 用于提交的user信息
				user_info: {
					id: null,
					name: '',
					phone_number: null,
					selected_major: '',
					access_project: '',
					examination_type: "",
					sex: '',
					province: '',
					city: '',
					area: '',
					// current_school: '',
					// current_class: '',
					address_detail: '',
					address_selected: '',
					
					// 新加的学历等信息
					graduated_school: '',
					education_degree: '',
					// is_graduated: '',
					graduated_year: '',
					graduated_month: '',
					id_card_numbers: '',
					
					// 正式报名 --- 工作信息
					obtained_certificate_name: "",
					obtained_certificate_time: null,
					// work_category: "",
					// work_duration: "",
					work_place: "",
					work_port: "",
					
					// pictures
					picture_id_card_positive: null,
					picture_id_card_negative: null,
					picture_sign: null,
					
					picture_portrait: null,
				},
				forest_info_ls: [
					'name',
					'phone_number',
					'selected_major',
					'examination_type',
					'sex',
					'province',
					'city',
					'area',
					// 'address_detail',
					'address_selected',
					// 'id_card_numbers',
					// 'current_school',
					// 'current_class',
				],
				formal_info_ls: [
					'name',
					'phone_number',
					'selected_major',
					'examination_type',
					'sex',
					'province',
					'city',
					'area',
					'address_detail',
					'address_selected',
					'access_project',
					'id_card_numbers',
					
					// 正式报名独有
					'graduated_school',
					'education_degree',
					// 'is_graduated',
					'graduated_year',
					'graduated_month',
					
					'obtained_certificate_name',
					'obtained_certificate_time',
					// 'work_category',
					// 'work_duration',
					'work_place',
					'work_port',
					
					// pictures
					'picture_id_card_positive',
					'picture_id_card_negative',
					'picture_sign',
					'picture_portrait',
				],
				formal_register_state: 'not_verified',
				
				// 正式报名
				obtained_certificate_name: {
					text: '已获证件',
					placeholder: '已获特种作业操作证',
					value: '',
					
					names: ['1', '2'],
				},
				obtained_certificate_time: {
					text: '获证时间',
					placeholder: '获得证件的时间',
					value: '',
					// 时间选择器组件
					datestype: 'date',
					startYear: '1990',
					endYear: '2023',
					dateString: '',
				},
				// work_category: {
				// 	text: '从事工种',
				// 	placeholder: '从事的工种',
				// 	value: '',
				// },
				// work_duration: {
				// 	text: '工作时间',
				// 	placeholder: '工作时间(单位: 月)',
				// 	value: '',
				// 	type: "number",
				// 	range: [0, 999],
				// 	maxlength: 3,
				// 	unit: '个月',
				// },
				work_place: {
					text: '工作单位',
					placeholder: '输入您的工作单位',
					value: '',
				},
				work_port: {
					text: '工作职务',
					placeholder: '输入您的工作职务',
					value: '',
				},
				
				// 学历信息
				education_degree: {
					text: '最高学历',
					placeholder: '选择您的最高学历',
					names: ['小学', '初中', '中专', '高中', '大专', '本科', '硕士及以上'],	// 删除"文盲"
					value: '',
				},
				examination_type: {
					text: '培训类型',
					placeholder: '选择想参加的培训类型',
					names: ['初训', '复训', '换证'],
					value: '',
				},
				
				// is_graduated: {
				// 	text: '是否毕业',
				// 	placeholder: '请选择您的毕业状态',
				// 	names: ['是', '否'],
				// 	value: '',
				// },
				
				graduated_school: {
					text: '毕业院校',
					placeholder: '最高学历的毕业院校',
					value: '',
				},
				graduated_year: {
					text: '毕业年份',
					placeholder: '请输入您的毕业年份',
					type: "number",
					value: '',
					range: [0, 2030],
					maxlength: 4,
					// check_after_input: true,
				},
				graduated_month: {
					text: '毕业月份',
					placeholder: '请输入您的毕业月份',
					value: '',
					type: "number",
					range: [1, 12],
					maxlength: 2,
				},
				// graduated_date: {
				// 	text: '毕业时间',
				// 	placeholder: '您最高学历的毕业时间',
				// 	value: '',
				// 	// 时间选择器组件
				// 	datestype: 'date',
				// 	startYear: '1950',
				// 	endYear: '2030',
				// 	dateString: '',
				// },
				id_card_numbers: {
					text: '身份证号',
					placeholder: '请输入您的身份证号码',
					value: '',
					type: "idcard",
					maxlength: 18,
				},
				
				// 前端界面信息
				current_school: {
					text: '当前学校',
					placeholder: '当前所在学校',
					value: '',
				},
				// current_class: {
				// 	text: '当前班级',
				// 	placeholder: '当前所在班级',
				// 	value: '',
				// },
				address_detail: {
					text: '详细地址',
					placeholder: '请输入您的详细地址',
					value: '',
					maxlength: 30,
				},
				phone_number: {
					text: '手机号',
					placeholder: '请输入您的手机号',
					type: "number",
					value: '',
				},
				verify_code_dc: {
					text: '验证码',
					placeholder: '短信验证码',
					// type: "number",
					value: '',
				},
				name: {
					text: '姓名',
					placeholder: '请输入您的姓名',
					value: '',
				},
				
				// bdpiker
				sex: {
					text: '性别',
					placeholder: '请选择您的性别',
					names: ['男', '女'],
					value: '',
				},
				
				// 省市区
				addressShow: false,
				form: {
					// 默认内蒙古
				    province: "150000",
				    city: "150100",
				    area: "1501219f2a",
				},
				address: '',
				
				// ------- 专业选择
				selected_major: {
					text: '所选工种',
					placeholder: '请选择专业',
					// names: ['计算机', '挖掘机', '会计'],
					names: [' ', '  '],
					value: '',
					// add_placeholder_to_names: true,
				},
				// ------- 专业选择
				access_project: {
					text: '准操项目',
					placeholder: '请选择准操项目',
					names: [' ', '  '],
					value: '',
				},
				
				_selected_major_ret_dc: null,
				major_list: [],
				hackReset: true,
				forceReset: true,		// v-if="forceReset"
				
				currentValue: '123',
				options: ["广东","上海","北京","深圳"],
				
				img_ls: [],
				
				picture_name_ls: ['picture_portrait', 'picture_sign', 'picture_id_card_positive', 'picture_id_card_negative'],
			}
		},
		onLoad(){
			this.init();
			this.getMajors();
			// access_project
			this.getAcessProjects();
			this.getCertificates();
		},
		onShow(){
			console.log('=== onShow ===');
			this.getValuesFromPrePage(this.picture_name_ls, this.user_info);
			// console.log('~~~ this._picture_sign: ', this['_picture_sign']);
		},
		onReady(){
				// var _this = this;
				// this.autoFillBottom('.fillBottom', 'swiperheight')
				this.autoFillBottom('.fillBottom', 'swiperheight')
		},
		methods: {
			autoFillBottom(class_selector, style_key){
				// 将指定class的高度填充为剩余屏幕. 该class的高度必须设置为this.style_key
				// eg:
				// <view class='buttons fillBottom' :style="{height:`${swiperheight}px`}">
				// class_selector = ".fillBottom";
				// style_key = 'swiperheight';
				
				var _this = this;
				uni.getSystemInfo({
					success: (resu) => {
						var query = uni.createSelectorQuery()
						query.in(_this).select(class_selector).boundingClientRect();
						query.exec(function(res) {
							// console.log('query.exec', res)
							if (!res[0]){
								console.log('*** query的res[0]为null!')
								return 0;
							}
							else{
								var residual = resu.windowHeight - res[0].top; //屏幕的高度减去当前swiper距离顶部的高度就是剩余屏幕的高度 然后动态赋值给swiper
								
								if (residual > 0)
									_this[style_key] = residual;
							}
						})
				   },
				   fail: (res) => {}
				})  
			},
			forceJump1(){
				this.scrollIndex = 1;
				console.log(this.scrollIndex,);
				console.log('================== this.verified', this.verified);
				// this.autoFillBottom('.fillBottom', 'swiperheight')
			},
			forceJump2(){
				this.scrollIndex = 2;
				console.log(this.scrollIndex);
				// this.autoFillBottom('.fillBottom_1', 'swiperheight_1')
			},
			tabChange(e){
				this.scrollIndex = e.index + 1;
				console.log('=== this.activeKey', this.activeKey);
				console.log('scrollIndex', this.scrollIndex);
				
				if (this.scrollIndex == 2){
					let that = this;
					setTimeout(function() {
					    that.autoFillBottom('.fillBottom_1', 'swiperheight_1')
						}
					, 1000);
				}
				
			},
			
			// 同意条款
			agreeItems(){
				
				var accepted_items = uni.getStorageSync('accepted_items');
				if (!accepted_items){
					function test(resolve, reject) {
							var that = this;
							uni.hideToast();
							uni.showModal({
								title: '正式报名服务条款',
								content: '根据教育部相关规定,\r\n 需要您上传姓名、学历、地址、身份证、电子签名等信息用于报名认证! \r\n 是否同意?',
								confirmText: "否",
								
								cancelText: "是",
								success: function(res) {
									console.log('~~~~~~~~~~~ success ', res);
									resolve(res)
									return
								},
								fail: function(res) {
									resolve(res)
									console.log('!!!!!!!!!!!!! fail', res);
								}
							});
					}
					
					if (this.user_info.is_active){
						var p1 = new Promise(test);
						let that = this;
						p1.then(function (result) {
							// 这里注意是反的, 左边为"是", 右边为"否"
						    console.log('成功返回：' + result.cancel);
							if (result.cancel){
								uni.setStorageSync('accepted_items', 1);
								return 0
							}
							else {
								uni.navigateBack({
									
								})
							}
						})
					}
				}
				
			},
			
			tabClick(e){
				console.log('user_info --- ', this.user_info);
			},
			onClickItem(val) {
				this.current = val.currentIndex
			},
			scollSwiper(e){
				this.current = e.target.current
			},
			setValue(key, value){
				this[key].value = value;
				this.user_info[key] = value;
			},
			onPullDownRefresh() {
				console.log('下拉刷新了111')
				uni.stopPullDownRefresh()
				
				this.page = 1
				this.goods = []
				this.flag = false
				setTimeout(()=>this.init(), 500)
				
				var url = '/pages/submitInfo/submitInfo';
				uni.navigateTo({
					url
				})
				// uni.reLaunch({
				//     url:url
				// });
			},
			init(){
				
				// uni.clearStorage();
				// 加载缓存
				// var value = 18510779120;
				var value = uni.getStorageSync('phone_number');
				
				// 初始化一些值, 便于测试
				this.setValue('phone_number', value);
				// this.setValue('verify_code_dc', 'ttod123');
				
				var cvalue = cache.get('verify_code_dc');
				// console.log('*** verify_code_dc cvalue', cvalue);
				if (cvalue){
					this.setValue('verify_code_dc', cvalue);
				}
				
			},
			getImageList(){
				let user_info = this.user_info;
				return [user_info.picture_portrait, user_info.picture_sign, user_info.picture_id_card_positive, user_info.picture_id_card_negative]
			},
			getSelectFunctionList(){
				console.log();
				return [this.picture_sign, this.picture_id_card_positive, this.picture_id_card_negative]
			},
			
			getValuesFromPrePage(key_ls, set_dc){
				// --- 接收从上个页面传过来的值
				// key_ls: 从上一个页面中传过来的key
				// set_dc: 将这个dict的key设置为对应变量
				
				/* 调用页面获取图片URL方法 */
				let pages = getCurrentPages();
				let currPage = pages[pages.length-1];
				let that = this;
				
				for(var i in key_ls){
					var key_i = key_ls[i];
					var tmp_key_i = '_' + key_i;
					var value_i = currPage.data[tmp_key_i];
					
					// console.log('for --- ', tmp_key_i, '~~', value_i);
					
					if(typeof(value_i) != undefined && value_i != null){
						console.log('成功获取临时变量tmp_key_i: ', tmp_key_i, ' --- ', value_i);
						set_dc[key_i] = value_i;
						
						currPage.data[tmp_key_i] = null;		// 只获取一次
					};
				}
			},
			
			chooseImage(index) {
				var user_img_key = this.getImageList()[index];
				var img_name = this.picture_name_ls[index];
				var tmp_img_name = '_' + img_name;
				
				console.log('=== index, img_name, user_img_key: ', index, img_name, user_img_key);
				
				console.log('this.user_info', this.user_info);
				let that = this;
				
				if(img_name == 'picture_sign') {
					// 测试[手写电子签名]
					uni.navigateTo({
						url: '../sign/sign?key=' + tmp_img_name
					})
				}
				else if (img_name == 'picture_id_card_positive')  {
					uni.navigateTo({
						url: '../scan-frame/scan-frame?key=' + tmp_img_name
					})
				}
				else if (img_name == 'picture_id_card_negative') {
					uni.navigateTo({
						url: '../scan-frame/scan-frame?photo_text=身份证反面(人像面)&key=' + tmp_img_name
					})
				}
				else if (img_name == 'picture_portrait') {
					uni.navigateTo({
						url: '../scan-frame/portrait?photo_text=肖像照&key=' + tmp_img_name
					})
				}
				else {
					uni.showToast({
						title: 'tmp_img_name取值错误!',
						icon: 'none'
					})
				}
				
				
				// const name_ls = ['picture_sign', 'picture_id_card_positive', 'picture_id_card_negative'];
				// this.getImageList()[index] = index;
				// this.user_info[name_ls[index]] = index;
				// console.log('======index', index, this.getImageList()[index]);
				
				
				// uni.chooseImage({
				//     count: 1, //默认9
				// 	sizeType: ['compressed'], //可以指定是原图还是压缩图，默认二者都有
				//     // sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图，默认二者都有
				//     sourceType: ['album'], //从相册选择
				//     success: function (res) {
				//         console.log(JSON.stringify(res.tempFilePaths));
				// 		console.log('tempFiles', JSON.stringify(res.tempFiles));
						
				// 		that.user_info[name_ls[index]] = res.tempFilePaths[0];
				// 		console.log('that.user_info', that.user_info);
				//     }
				// });
				return 1
			},
			getImageTextList(index){
				return ['肖像照', "手写电子签名", "身份证正面照\n(国徽面)", "身份证反面照\n(人像面)", ][index]
			},
			test22:function(vvv) {  
			                    if (vvv > 0) {  
			                        return true;  
			                    } else {  
			                        return false;  
			                    }  
			                } ,
			//删除 test_image
			selec(index) {
				var dc = {
					0: 'picture_portrait',
					1: 'picture_sign',
					2: 'picture_id_card_positive',
					3: 'picture_id_card_negative',
				};
				this.user_info[dc[index]] = undefined;
			},
			async clickedverifyCodeButton(user_info) {
				if ( user_info ){
					// 验证码缓存一段时间
					cache.set('verify_code_dc', this.verify_code_dc.value, 10*60);
					
					this.verified = true;
					
					uni.showToast({
					    title: '加载用户信息中...',
						icon: 'loading',
					    duration: 5000
					});
					var is_submitted = await this.getUserSubmitedInfo();
					// console.log('------ is_submitted: ', is_submitted)
					
					uni.hideToast()
					
					return uni.showToast({
						title: '验证成功!',
						icon: 'success',
						position: 'center',
						duration: 1000,
					});
					
				}
			},
			preview(urls) {
				this.api.previewImages(urls);
			},
			getImgLs(){
				this.img_ls = [this.user_info.picture_sign];
				// console.log('~~ img_ls: ', this.img_ls);
			},
			
			async getUserSubmitedInfo(){
				console.log('--- 尝试获取用户已经提交的信息 ---');
				var myData =  {
						'phone_number': this.user_info.phone_number,
						'order_type_ls': ['-id', ],
				};
				if(! myData['phone_number']){
					// console.log('myData的phone_number为空, 不能查询用户信息!');
					uni.showToast({
						title: 'myData的phone_number为空, 不能查询用户信息!',
						icon: 'none'
					})
					return 0;
				}
				
				// console.log('userinfophonenumber', user_info.phone_number);
				// 设置缓存
				uni.setStorageSync('phone_number', this.user_info.phone_number);
				
				// 加载缓存
				// var value = uni.getStorageSync('phone_number');
				// console.log('====== getStorageSync_value', value, user_info);
				
				
				const res = await this.$myGetFunction({
					url: '/api/index/ForecastRegistration/',
					data: myData,
				})
				console.log('*** myData', myData)
				console.log('***** res: ', res);
				
				var result = res.data.result;
				if (result.data.length == 0){
					console.log('--- 未找到用户信息! 应该是第一次报名.')
					let that = this;
					function checkShouldGoBack(that){
						if(that.scrollIndex == 2){
							uni.hideToast()
							uni.showToast({
								title: '请先预报名!',
								icon: 'error',
								duration: 2000,
							})
							that.forceJump1()
							
						}
					}
					setTimeout(()=>checkShouldGoBack(that), 1000)
					return 0
				}
				
				var resp_user_info = result.data[0];
				
				function test(resolve, reject) {
					// return new Promise(function (resolve, reject) {
						console.log('打开框框~~~~~~~')
						
						var that = this;
						uni.hideToast();
						uni.showModal({
							title: '服务器同步',
							content: '检测到您已有提交记录,\r\n 是否在此基础上进行修改?',
							confirmText: "否",
							// confirmColor: "#000",
							
							cancelText: "是",
							// cancelColor: "#eee",
							success: function(res) {
								console.log('~~~~~~~~~~~ success ', res);
								resolve(res)
								return
							},
							fail: function(res) {
								resolve(res)
								console.log('!!!!!!!!!!!!! fail', res);
							}
						});
					// }
				}
				var p1 = new Promise(test);
				let that = this;
				p1.then(function (result) {
					// var result = JSON.parse(resolve);
				    console.log('成功：' + result.confirm);
					if (result.confirm){
						console.log('~~~~~~~~~~~ 拒绝拉取数据! 仅同步id和is_active. end program. ');
						// console.log(resp_user_info);
						that.user_info.id = resp_user_info.id;
						that.user_info.is_active = resp_user_info.is_active;
					}
					else{
						// 开始赋值
						let data_dc = that._data
						for(var k in resp_user_info){
							var v = resp_user_info[k];
							
							if (data_dc[k]){
								data_dc[k].value = resp_user_info[k];
							}
							data_dc.user_info[k] = resp_user_info[k];
						}
						that.address = resp_user_info['address_selected'];
					}
					that.formal_register_state = 'has_verified'
					
					if (that.user_info.is_active) {
						that.agreeItems();
					}
					
					// that.user_info.id = resp_user_info.id;
					that.user_info.is_active = resp_user_info['is_active'];
					that._data.user_info['is_active'] = resp_user_info['is_active'];
					that._data.user_info['id'] = resp_user_info['id'];
					
					console.log("that._data.user_info['is_active'] ~~~~ ", that._data.user_info['is_active']);
					console.log("resp_user_info ~~~~ ", resp_user_info);
					
				})
				
				
				
			},
			
			async getCertificates() {
				// var myData =  {
				// 		'phone_number': this.user_info.phone_number,
				// 		'order_type_ls': ['-id', ],
				// };
				// var myData = null;
				const res = await this.$myGetFunction({
					url: '/api/myconf/Certificate/',
					// data: myData,
				})
				// console.log('*** myData', myData)
				// console.log('***** res: ', res);
				
				// var result = res.data.result;
				var data = res.data.result.data;
				
				// this.api.myGetFunction();
				// console.log('~~~ Certificate', res);
				this.obtained_certificate_name.names = []
				this.major_list = []
				for(var i = 0; i < data.length; i++){
					var d = data[i]['name'];
					this.obtained_certificate_name.names.push(d);
				}
			},
			
			async getAcessProjects() {
				var url = "/api/myconf/AccessProject/";
				// var resp = this.api.myGetFunction({
				// 	url: url
				// })
				// console.log(resp);
				
				const resp = await this.api.myGetFunction({
					url: url,
				})
				
				var data = resp.data.result.data;
				this.access_project.names = this.api.get_keyname_value(data, 'name');
			},
			getMajors() {
				uni.request({
					method: 'GET',
				    url: this.$baseUrl + '/api/myconf/Major/',
					success: (res) => {
						var data = res.data.result.data;
						
						this.selected_major.names = []
						this.major_list = []
						for(var i = 0; i < data.length; i++){
							var d = data[i]['name'];
							this.selected_major.names.push(d);
						}
						
						this._selected_major_ret_dc = data;
						// console.log('this._selected_major_ret_dc', data);
						
						// --- (已通过v-model解决)重新加载子组件的两种方案, hackReset: 强制重载, $refs: 直接修改子组件的数据
						// this.hackReset = false;
						// this.$nextTick(() => {
						//    this.hackReset = true;
						// })
						// this.$refs.child.names = this.selected_major.names;    // 这句很重要
					}
				});
				
			},
			picture_sign(e){
				var filePath0 = e.tempFilePaths[0];
				this.user_info.picture_sign = filePath0;
				console.log('选择文件picture_sign：', filePath0);
			},
			picture_id_card_positive(e){
				var filePath0 = e.tempFilePaths[0];
				this.user_info.picture_id_card_positive = filePath0;
				console.log('选择文件picture_id_card_positive：', filePath0);
			},
			picture_id_card_negative(e){
				var filePath0 = e.tempFilePaths[0];
				this.user_info.picture_id_card_negative = filePath0;
				console.log('选择文件picture_id_card_negative：', filePath0);
			},
			addresspick(obj) {
				let arr = [ 'province', 'city', 'area'];
				let place = '';

				arr.map(key => {
					this.form[key] = obj[key].AreaId
					place += obj[key].AreaName + "/"
				})
				place = place.substring(0, place.length - 1);
				this.address = place;
				
				this.user_info.address_selected = place;
				this.user_info.province = obj['province'].AreaName
				this.user_info.city = obj['city'].AreaName
				this.user_info.area = obj['area'].AreaName
			},
			getPickerMsg(res){
				// 仅适用于bdpicker, 将value赋值到对应的组件dc中.
				let data_dc = this._data
				for(var k in data_dc){
					var v = data_dc[k];
					// console.log('k, v', k, v)
					
					if (!v) {
						continue;
					}
					if (v['text'] == res.dc['text'] && v['placeholder'] == res.dc['placeholder']){
						v.value = res.value;
						// 赋予user_info
						data_dc.user_info[k] = v.value;
					}
				}
				
				var picker_text = '所选工种'
				if (res.dc['text'] == picker_text){
					var cache_key = null;
					var index = this.api.get_index_by_kv_in_dc_ls(this._selected_major_ret_dc, 'name', res['value'])
					
					var dc = this._selected_major_ret_dc[index];
					
					// console.log('index', index, dc);
					
					var title = '报名须知';
					var content = "";
					var age_max = dc['age_max'];
					var age_min = dc['age_min'];
					var education_degree_limit = dc['education_degree_limit'];
					
					var age_limit_string;
					if (!age_min && !age_max){
						age_limit_string = null
					}
					else if (age_min && !age_max){
						age_limit_string = '年龄必须大于' + age_min + '周岁.\n'
					}
					else if (!age_min && age_max){
						age_limit_string = '年龄必须小于' + age_max + '周岁.\n'
					}
					else if (age_min && age_max){
						age_limit_string = '年龄必须大于' + age_min + '周岁\n且小于' + age_max + '周岁.\n'
					}
					else {
						console.log('age_limit_string error!!!')
					}
					
					
					var education_degree_limit_string = "";
					if (education_degree_limit && education_degree_limit != '文盲') {
						education_degree_limit_string = '学历必须' + education_degree_limit + '以上.\n';
					}
					
					
					if (age_limit_string){
						content = dc['name'] + '报名要求:\n' +　age_limit_string;
					}
					if (education_degree_limit_string){
						if (age_limit_string){
							content += education_degree_limit_string;
						}
						else {
							content =  dc['name'] + '报名要求:\n' +　education_degree_limit_string;
						}
					}
					
					if (content){
						content += '请确认您是否满足要求?'
						this.show_selected_mojor_modal(title, content, res.dc);
					}
				}
			},
			
			// 同意条款
			async show_selected_mojor_modal(title='hahaa', content='hhh', dc){
				
				console.log('show_selected_mojor_modal dc', dc);
				if (1){
					function test(resolve, reject) {
							var that = this;
							uni.hideToast();
							uni.showModal({
								title: title,
								content: content,
								confirmText: "否",
								
								cancelText: "是",
								success: function(res) {
									console.log('~~~~~~~~~~~ success ', res);
									resolve(res)
									return
								},
								fail: function(res) {
									resolve(res)
									console.log('!!!!!!!!!!!!! fail', res);
								}
							});
					}
					var p1 = new Promise(test);
					let that = this;
					p1.then(function (result) {
						// 这里注意是反的, 左边为"是", 右边为"否"
						console.log('成功返回：' + result.cancel);
						if (result.cancel){
							// uni.setStorageSync(cache_key, 1);
							return 0
						}
						else {
							// 验证过手机号, 且没提交过预报名的, 才记入数据库中, 否则直接忽略
							if (that.user_info.id)
								return 0;
							// else {
							// 	console.log('--- 录入数据库!')
							// 	return 1;
							// }
							
							if (that.verified){
								var data = {};
								
								for (var i in that.$data.forest_info_ls){
									var key = that.$data.forest_info_ls[i];
									
									var dc = that[key];
									
									if (dc)
									{
										var value = dc['value'];
										console.log('key value', key, '---', value);
										if (value)
											data[key] = value;
									}
									else
										console.log('key dc ---', key, dc);
									
								}
								
								console.log('~~~ data', data);
								var url = '/api/index/LostUser/';
								const res = that.api.myRequest({
									method: 'POST',
									url: url,
									data: data,
								});
								// console.log('res === ', res);
							}
							uni.navigateBack();
						}
					})
				}
				
			},
			
			show_modal111(title='hahaa', content='hhh'){
				uni.showModal({
					title: title,
					content: content,
				});
			},
			getMsg(res){
				// 仅适用于bdinput, 将value赋值到对应的组件dc中.
				let data_dc = this._data
				for(var k in data_dc){
					var v = data_dc[k];
					if (!v) {
						continue;
					}
					
					if (v['text'] == res.dc['text'] && v['placeholder'] == res.dc['placeholder']){
						v.value = res.value;
						// 赋予user_info
						data_dc.user_info[k] = v.value;
						// console.log('~~~ k: ', k, 'v.value: ', v.value);
					}
				}
			},
			
			//*上传图片*//
			async uploadimage1() {
				console.log('---------- 开始上传图片 ------')
				uni.showToast({
				    title: '数据上传中...',
					icon: 'loading',
				    duration: 8000
				});
				var myUrl = this.newUrl;
				// var myUrl = this.$baseUrl + '/api/index/ForecastRegistration/99/';
				const name_ls = ['picture_sign', 'picture_id_card_positive', 'picture_id_card_negative', 'picture_portrait'];
				// const name_ls = this.picture_name_ls;
				
				var i = -1;
				var field_name = "";
				var img_path = "";
				// 上传已保存的照片
				// const tempFilePaths = this.imglist;
				console.log('~~~ myUrl:', myUrl);
				
				i += 1;
				field_name = name_ls[i];
				img_path = this.user_info[field_name]
				console.log('~~~~~~~~~~~~~~ i field_name:', i, field_name);
				console.log('---1111111111 img_path ', img_path)
				if (!img_path){
					uni.hideToast()
					
					var msg = '第 ' + (i + 1) + ' 张图片的格式不对!';
					uni.showToast({
						title: msg,
						icon: 'none',
						position: 'center'
					});
					return 0
				}
				
				console.log('~~~~~~~~~~ 开始上传第1张图片! ~~~~~~~~~~~~~')
				// 第一张图片 picture_sign
				await uni.uploadFile({
				    url: myUrl,
				    filePath: img_path,
				    name: field_name,
				    formData: {
						'post_type': 'update',
						'img_path': img_path,
						'from': 'uniapp' ,
				    },
				    success: (uploadFileRes) => {
						console.log('*** uploadFileRes.data', uploadFileRes.data);
						var data = JSON.parse(uploadFileRes.data);
						if(200 <= data.status < 300){
							console.log(i, '*** Update Successfully!', field_name);
						}
						console.log(i, '--- data: ', data);
						
						i += 1;
						field_name = name_ls[i];
						img_path = this.user_info[field_name]
						console.log('~~~~~~~~~~~~~~ i field_name:', i, field_name);
						console.log('--- img_path ', img_path)
						if (!img_path){
							uni.hideToast()
							
							var msg = '第 ' + (i + 1) + ' 张图片的格式不对!';
							uni.showToast({
								title: msg,
								icon: 'none',
								position: 'center'
							});
							return 0
						}
						
						// 第二张图片 picture_id_card_positive'
						uni.uploadFile({
						    url: myUrl,
						    filePath: img_path,
						    name: field_name,
						    formData: {
								'post_type': 'update',
								'img_path': img_path,
								'from': 'uniapp' ,
						    },
							success: (uploadFileRes) => {
								var data = JSON.parse(uploadFileRes.data);
								if(200 <= data.status < 300){
									console.log(i, '*** Update Successfully!', field_name);
								}
								console.log(i, '--- data: ', data);
								
								i += 1;
								field_name = name_ls[i];
								img_path = this.user_info[field_name]
								console.log('~~~~~~~~~~~~~~ i field_name:', i, field_name);
								console.log('--- img_path ', img_path)
								if (!img_path){
									uni.hideToast()
									
									var msg = '第 ' + (i + 1) + ' 张图片的格式不对!';
									uni.showToast({
										title: msg,
										icon: 'none',
										position: 'center'
									});
									return 0
								}
								
								// 第三张图片 picture_id_card_negative
								uni.uploadFile({
								    url: myUrl,
								    filePath: img_path,
								    name: field_name,
								    formData: {
										'post_type': 'update',
										'img_path': img_path,
										'from': 'uniapp' ,
								    },
									success: (uploadFileRes) => {
										var data = JSON.parse(uploadFileRes.data);
										if(200 <= data.status < 300){
											console.log(i, '*** Update Successfully!', field_name);
										}
										console.log(i, '--- data: ', data);
										
										uni.hideToast()
										return uni.showToast({
											title: '预报名成功~',
											icon: 'success',
											position: 'center'
										});
									},
								})
							},
						})
				    }
				});
				
			},
			
			async uploadimage() {
				console.log('---------- 开始上传图片 ------')
				uni.showToast({
				    title: '数据上传中...',
					icon: 'loading',
				    duration: 8000
				});
				// this.newUrl = '/api/index/ForecastRegistration/848/';
				var myUrl = this.newUrl;
				const name_ls = this.picture_name_ls;
				const n_pictures = name_ls.length;
				// console.log('*** name_ls, n_pictures', name_ls, n_pictures)
				// const name_ls = ['picture_sign', 'picture_id_card_positive', 'picture_id_card_negative'];
				
				var i = 0;
				var field_name = "";
				var img_path = "";
				var tag = ''
				console.log('~~~~~~~~~~ 开始上传图片! ~~~~~~~~~~~~~')
				
				var option_ls = [];
				for (var i = 0; i < n_pictures; i++) {
					field_name = name_ls[i];
					img_path = this.user_info[field_name];
					tag = '第' +　(i+1).toString() + '张图片';
					var option_i = {
						not_add_base_url: true,
						tag: tag,
						url: myUrl,
						filePath: img_path,
						name: field_name,
						formData: {
							'post_type': 'update',
							'img_path': img_path,
							'phone_number': this.phone_number.value,
							'verify_code_value': this.verify_code_dc.value,
							'from': 'uniapp' ,
						},
					};
					
					if (!img_path){
						var msg = option_i.tag + "的地址为空!!!"
						uni.showToast({
							title: msg,
							icon: 'none',
							duration: 1000
						});
						return 0
					}
					
					// option_ls.concat([option_i])
					option_ls[i] = option_i;
				}
				console.log(option_ls);
				var p0 = this.api.uploadFileFunction(option_ls[0]);
				let log = console.log;
				
				let that = this;
				p0.then(function (result) {
					log('result p0 --- ', result);
					
					if (that.api.is_contains(result.toString(), '地址为空')){
						return
					}
					
					var p1 = that.api.uploadFileFunction(option_ls[1]);
					p1.then(function (result) {
						log('result p1 --- ', result);
						
						// that.api.uploadFileFunction(option_ls[2]).then(function (result) {
						// 	uni.showToast({
						// 		title: '图片上传成功!',
						// 		icon: 'success',
						// 		duration: 3000
						// 	})
						// })
						
						if (that.api.is_contains(result.toString(), '地址为空')){
							return
						}
						var p2 = that.api.uploadFileFunction(option_ls[2]);
						p2.then(function (result) {
							log('result p2 --- ', result);
							
							if (that.api.is_contains(result.toString(), '地址为空')){
								return
							}
							var p3 = that.api.uploadFileFunction(option_ls[3]);
							p3.then(function (result) {
								if (that.api.is_contains(result.toString(), '地址为空')){
									return
								}
								uni.showToast({
									title: '上传成功!',
									icon: 'success',
									duration: 3000
								})
							})
						})
						
					})
				})
				
				
			},
			
			// 提交基本信息
			async submitBaseInfo() {
				console.log('--- 上传基本信息 ---', this.verified);
				if (!this.verified){
					uni.showToast({
						title: '请先进行手机号验证!',
						icon: 'none',
						position: 'center'
					});
					return
				}
				
				var myUrl = this.$baseUrl + '/api/index/ForecastRegistration/';
				var method = 'POST'
				
				var url_1 = myUrl;		// 根据不同用户, 可能会由post变成put
				console.log('~~~ method, myurl:', method, '-', myUrl);
				
				// 判断是否有为空的数据, 有的话, 就不予提交
				var CHECK_EXIST_EMPTY_FIELD = 1;
				if (CHECK_EXIST_EMPTY_FIELD){
					var data = this.user_info;
					var new_data = JSON.parse(JSON.stringify(this.user_info));
					for(var k in data){
						// console.log('submigBaseInfo --- k:', k);
						// console.log('k in formal_info_ls', this.$data.formal_info_ls.indexOf(k) != -1);
						
						if(this.scrollIndex == 1){
							// 在这里只检测k是否属于预报名的字段, 是的话再继续检测
							if(this.$data.forest_info_ls.indexOf(k) == -1){
								delete new_data[k];
								continue;
							}
						}
						else if(this.scrollIndex == 2){
							// 检测k是否为正式报名字段
							if(this.$data.formal_info_ls.indexOf(k) == -1){
								delete new_data[k];
								continue;
							}
							// console.log('=== 是否为正式报名字段 ===', k, '===', this.$data.formal_info_ls.indexOf(k))
						}
						else
							console.log('scrollIndex取值错误! --- ', this.scrollIndex)
						
						var v = data[k];
						
						// 检查是否user_info中有未填写的字段, 有的话, 就告诉用户 
						var warnning_text = '';
						
						// 测试某一个有问题的字段 test_key
						// var test_key = 'obtained_certificate_time';
						// if (k == test_key){
							
						// 	console.log(test_key, ' === ', v, '==', v != false && (!v));
						// 	console.log(test_key, ' ~~~ ', v, '==', (v == null || v == undefined || v == '') && v != false);
						// 	if (!v){
						// 		console.log('~~~~~~~~~~~~~~~!!!!!1', v);
						// 		return;
						// 	}
						// 	return;
						// }
						// console.log('k: ', k, '~~~ v:', v, '==', (v == null || v == undefined || v == '') && v != false);
						
						if (!v) {
							// console.log('1 --- k, v', k, '---', v);
							// if (v == false)
							// 	continue;
							
							// if(data['obtained_certificate_name'].value == '无')
							
							// console.log('2 --- k, v', k, '---', v);
							if (k == 'address_selected'){
								warnning_text = '[地址选择]字段不能为空!'
							}
							else if (k == 'obtained_certificate_time'){
								if (this._data['obtained_certificate_name'].value != '无') {
									var base_data_class = this._data[k];
									if (base_data_class){
										warnning_text = '[' + base_data_class.text + ']字段不能为空!';
									}
								}
							}
							else if (k == 'picture_id_card_negative'){
								warnning_text = '[身份证反面_人像面]字段不能为空!'
							}
							else if (k == 'picture_id_card_positive'){
								warnning_text = '[身份证正面_国徽面]字段不能为空!'
							}
							else if (k == 'picture_sign'){
								warnning_text = '[电子签名]字段不能为空!'
							}
							else{
								// console.log('3 --- k, v', k, '---', v);
								var base_data_class = this._data[k];
								if (base_data_class){
									warnning_text = '[' + base_data_class.text + ']字段不能为空!';
								}
								// console.log('!!! === ', k, '~~', base_data_class, '~~', warnning_text);
							}
						}
						// console.log('---', k, v, '---', warnning_text);
						if (warnning_text){
							uni.showToast({
								title: warnning_text,
								icon: 'none',
							})
							// console.log(warnning_text);
							return;
						}
					}
					// console.log('强制暂停...')
					// return 1;
				}
				
				// 先删除3个图片字段
				// var data = JSON.parse(JSON.stringify(this.user_info));
				var data = new_data;
				delete data['picture_id_card_negative']
				delete data['picture_id_card_positive']
				delete data['picture_sign']
				delete data['picture_portrait']
				
				if(this.scrollIndex == 2){
					// 正式报名字段设置为true
					data['is_formal_registration'] = true;
				}
				else{
					delete data['is_formal_registration']
				}
				
				if (this.user_info.id != undefined){
					url_1 += this.user_info.id.toString() + '/';
					data.post_type = 'update'
				}
				data.verify_code_value = this.verify_code_dc.value;
				
				await uni.request({
					method: method,
					url: url_1,
					data: data,
					success: (res) => {
						if(res.data.status < 200 || res.data.status >= 300){
							console.log('*** 错误: ', res.data.msg);
							uni.showToast({
								title: 'error: ' +  res.data.msg,
								icon: 'none',
								duration: 5000,
							})
							return ;
						}
						
						console.log('--- res.data: ', res.data);
						var result = res.data.result;
						var newUrl = myUrl + result.id.toString() + '/';
						
						console.log('--- newUrl: ', newUrl);
						this.newUrl = newUrl;
						
						this.user_info.id = result.id;
						
						// 这里出bug了, xxx is not a function. 这是因为res要用指针=>, 不能直接=等于.
						// this.picture_sign("a");
						if (this.scrollIndex == 2){
							this.uploadimage();
							uni.hideToast()
							uni.showToast({
								title: '正式报名成功!',
								icon: 'success',
								duration: 5000
							})
						}
						else {
							uni.showModal({
								title: '预报名成功',
								content: '已收到您的预报名请求,\r\n请在收到审核成功的短信通知后,\r\n再进行正式报名.',
								showCancel: false,		//没有取消按钮的弹框
							});
						}
					},
					fail(err) {
						uni.showToast({
							title: '获取数据失败',
							icon: 'none',
						})
					}
				})
				
			},
			
			// testing...
			async showName(){
				console.log(this.user_info.id, this.user_info.is_active);
				// console.log(this.user_info);
				// console.log(this._data);
			},
			
			// 提交数据
			showData() {
				// let data_dc = this._data
				// for(var k in data_dc){
				// 	var v = data_dc[k];
				// 	console.log('~~~ ', k, ' - ',  v);
				// }
				this.submitBaseInfo();
				// this.uploadimage();
			},
			formalRegister(){
				console.log('~~~');
				this.submitBaseInfo();
			}
			
		}
	}
</script>


<style lang="scss" scoped>
	.formal_text {
		font-weight:bold;
		// font-size: 48upx;
		// text-align:center;
		margin-left: 10rpx;
		padding-bottom: 5rpx;
		padding-top: 5rpx;
		padding-left: 5rpx;
		background-color: #18BC37;
	}
	
	uni-modal .uni-modal__bd{      
	    white-space: pre-wrap;      
	}
	
	// 标题
	.page-title{
		font-weight:bold;
		font-size: 48upx;
		text-align:center;
		// margin-bottom: 40upx;
	}
	
	// 间隔栏
	.interval_bar{
		height: 20rpx;
		background-color: #F4F5F6;
	}
	
	// 地址选择框视图
	.picker_view {
		width: 100%;
		display: flex;
		border-top: 3upx solid #ccc;
		border-bottom: 3upx solid #ccc;
		padding: 20upx;
	}
	.picker_text {
		width: 25%;
	}
	
	// 地址选择框
	.picker {
		width: 65%;
		float: right;
		display: block;
	}
	.picker_input {
		width: 80%;
		float: left;
		text-align: right;
		margin-right: 10upx;
		// margin-left: 40upx;
	}
	.picker_icons {
		float: right;
		width: 20%;
	}
	
	// 图片容器
	.images_container{
		width: 98%;
		border: 1% solid red;
		display: flex;
		flex-wrap: wrap;
		justify-content: space-around;		// space-between space-around space-evenly
		
		padding-left: 20rpx;
		padding-right: 20rpx;
		padding-top: 10rpx;
		padding-bottom: 10rpx;
		
		.dont_have_img_container {
			width: 300rpx;
			height: 245rpx;
			flex: 0 0 50%;
			
			border-radius: 20rpx;
			position: relative;
			box-shadow: 0 10rpx 40rpx rgba(0, 0, 0, .3);
			
			padding-left: 10rpx;
			padding-right: 10rpx;
			padding-top: 5rpx;
			padding-bottom: 5rpx;
			
			margin-bottom: 30rpx;
			
			display: flex;
			align-items: center;
			justify-content: center;
			
			.img_text {
				vertical-align:middle;
				text-align:center;
				font-size: 30upx;
			}
		};
		.show_img{
			width: 300rpx;
			height: 200rpx;
			flex: 0 0 50%;
			margin-bottom: 30rpx;
			padding-left: 10rpx;
			padding-right: 10rpx;
		};
	}
	
	.img {
		color: #303133;
	}
	
	// 展示图片的容器
	.show_img_container {
		position: relative;
	}
	.show_img {
		width: 135upx;
		height: 135upx;
		margin-left: 5upx;
		margin-right: 10upx;
		color: #303133;
		position: relative;
		
		border-color: #aeafb3;
		border-width: 2;
		border-radius: 2px;
		border-style: dashed;
		padding: 20upx,
	}
	
	// 删除图标 test_image
	.shancs {
		width: 8vw;
		height: 8vw;
		color: #eee;
		position: absolute;
		top: -5upx;
		right: -3upx;
		z-index: 1;
	}
	
	.buttons {
		display: flex;
		padding: 10upx;
		background-color: #eee;
		.submit_button {
			width: 400upx;
			height: 90upx;
			float: right;
			background-color: $background-color;
			color: #fff;
		}
	}
	
</style>

